package com.sub.project.info.service.impl;

import com.sub.framework.aspectj.lang.annotation.DataSource;
import com.sub.framework.aspectj.lang.enums.DataSourceType;
import com.sub.project.info.domain.Attribute;
import com.sub.project.info.domain.MtoPost;
import com.sub.project.info.mapper.AttributeMapper;
import com.sub.project.info.mapper.BlogMapper;
import com.sub.project.info.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@DataSource(value = DataSourceType.SLAVE)
public class BlogServiceImpl implements BlogService {

    @Autowired
    private BlogMapper blogMapper;
    @Autowired
    private AttributeMapper attributeMapper;

    @Override
    public List<MtoPost> list() {
        return blogMapper.selectList();
    }

    @Override
    public Attribute findById(Integer id) {
          return attributeMapper.selectById(id);
    }
}
